import request from './'
// import { baseURL } from './'

// 登录
function login (data, params) {
    return request.post({
        url: '/login',
        data,
        params
    })
}

// 停车场
const Parking = {
    // 添加停车场
    add: (data, params) => request.post({ url: '/addParking', data, params }),
    // 获取停车场列表
    getParkingList: (data, params) => request.post({ url: '/getParkingList', data, params }),
    // 获取停车场详情
    getParkingById: (data, params) => request.post({ url: '/getParkingById', data, params }),
    // 编辑停车场
    editParking: (data, params) => request.post({ url: '/editParking', data, params }),
    // 删除停车场
    delPark: (data, params) => request.post({ url: '/delPark', data, params }),
    // 添加停车场区域
    addArea: (data, params) => request.post({ url: '/addArea', data, params }),
    // 添加停车场区域
    delArea: (data, params) => request.post({ url: '/delArea', data, params }),
    // 编辑停车场区域
    editArea: (data, params) => request.post({ url: '/editArea', data, params }),
    // 获取停车场区域
    getAreaList: (data, params) => request.post({ url: '/getAreaList', data, params }),
    // 添加停车位
    addSpace: (data, params) => request.post({ url: '/addSpace', data, params }),
    // 停车位列表
    getSpaceList: (data, params) => request.post({ url: '/getSpaceList', data, params }),
    // 编辑停车位
    editSpace: (data, params) => request.post({ url: '/editSpace', data, params }),
    // 删除停车位
    delSpace: (data, params) => request.post({ url: '/delSpace', data, params }),
}

// 车辆
const Car = {
    // 添加车辆
    addCar: (data, params) => request.post({ url: '/addCar', data, params }),
    // 获取车辆列表
    getCarList: (data, params) => request.post({ url: '/getCarList', data, params }),
    // 获取停车场详情
    getParkingById: (data, params) => request.post({ url: '/getParkingById', data, params }),
    // 编辑车辆
    editCar: (data, params) => request.post({ url: '/editCar', data, params }),
    // 车辆删除
    delCar: (data, params) => request.post({ url: '/delCar', data, params }),
    // 黑名单
    addBlack: (data, params) => request.post({ url: '/addBlack', data, params }),
    // 撤销黑名单
    delBlack: (data, params) => request.post({ url: '/delBlack', data, params }),
    // 获取黑名单列表
    getBlack: (data, params) => request.post({ url: '/getBlack', data, params }),
    // 获取所有车辆列表
    getAllCarList: (data, params) => request.post({ url: '/getAllCarList', data, params }),
    // 黑名单
    addCarBlack: (data, params) => request.post({ url: '/addCarBlack', data, params }),
    // 修改用户车辆
    updateUserCar: (data, params) => request.post({ url: '/updateUserCar', data, params }),
    // 删除用户车辆
    delUserCar: (data, params) => request.post({ url: '/delUserCar', data, params }),
}

// 用户
const User = {
    // 添加用户
    addUser: (data, params) => request.post({ url: '/addUser', data, params }),
    // 获取用户列表
    getUserList: (data, params) => request.post({ url: '/getUserList', data, params }),
    // 编辑车辆
    editUser: (data, params) => request.post({ url: '/editUser', data, params }),
    // 车辆删除
    delUser: (data, params) => request.post({ url: '/delUser', data, params }),
    // 重置密码
    resetUserPwd: (data, params) => request.post({ url: '/resetUserPwd', data, params }),
    // 删除用户
    closeUser: (data, params) => request.post({ url: '/closeUser', data, params }),
    // 添加app用户
    appRegister: (data, params) => request.post({ url: '/appRegister', data, params }),
    // 编辑app用户
    editAppUser: (data, params) => request.post({ url: '/editAppUser', data, params }),
}

// 角色
const Role = {
    // 添加角色
    addRole: (data, params) => request.post({ url: '/addRole', data, params }),
    // 获取角色列表
    getRoleList: (data, params) => request.post({ url: '/getRoleList', data, params }),
    // 编辑角色
    editRole: (data, params) => request.post({ url: '/editRole', data, params }),
    // 角色删除
    delRole: (data, params) => request.post({ url: '/delRole', data, params }),
    // 通过角色id查询权限
    getPowerById: (data, params) => request.post({ url: '/getPowerById', data, params }),
}

// 菜单
const Menu = {
    // 获取菜单列表
    getMenuList: (data, params) => request.post({ url: '/getMenuList', data, params }),
    // 添加菜单
    addMenu: (data, params) => request.post({ url: '/addMenu', data, params }),
    // 编辑菜单
    editMenu: (data, params) => request.post({ url: '/editMenu', data, params }),
    // 菜单删除
    delMenu: (data, params) => request.post({ url: '/delMenu', data, params }),
}

// 账号
const Admin = {
    // 获取账号列表
    getAdminList: (data, params) => request.post({ url: '/getAdminList', data, params }),
    // 添加账号
    addAdmin: (data, params) => request.post({ url: '/addAdmin', data, params }),
    // 编辑账号
    editAdmin: (data, params) => request.post({ url: '/editAdmin', data, params }),
    // 账号删除
    delAdmin: (data, params) => request.post({ url: '/delAdmin', data, params }),
    // 充值密码
    resetPwd: (data, params) => request.post({ url: '/resetPwd', data, params }),
}

// 订单
const Order = {
    // 获取列表
    getAllOrder: (data, params) => request.post({ url: '/getAllOrder', data, params }),
}

// 公告
const Note = {
    // 添加公告
    addNote: (data, params) => request.post({ url: '/addNote', data, params }),
    // 删除公告
    delNote: (data, params) => request.post({ url: '/delNote', data, params }),
    // 编辑公告
    editNote: (data, params) => request.post({ url: '/editNote', data, params }),
    // 获取公告
    getNote: (data, params) => request.post({ url: '/getNote', data, params }),
}

export default {
    login,
    Parking,
    Car,
    User,
    Role,
    Menu,
    Admin,
    Order,
    Note
}
